-
Notifications
You must be signed in to change notification settings - Fork 8.2k
linker: aarch32: automatic derivation of region names from devicetree nodes #36196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linker: aarch32: automatic derivation of region names from devicetree nodes #36196
Conversation
Add a label to `sramN` nodes (Where N is 1-4) to enable automatic generation of memory region names from the devicetree node. Performed by regex find and replace in vscode using: find - `^(\t*)sram(1|2|3|4):([^}]*|\n*)\};` replace - `$1sram$2:$3\tlabel = "SRAM$2";\n$1};` Signed-off-by: Jordan Yates <[email protected]>
Add a label to `dtcm` nodes to enable automatic generation of memory region names from the devicetree node. Performed by regex find and replace in vscode using: find - `^(\t*)dtcm:([^}]*|\n*)\};` replace - `$1dtcm:$2\tlabel = "DTCM";\n$1};` Signed-off-by: Jordan Yates <[email protected]>
Add a label to `itcm` nodes to enable automatic generation of memory region names from the devicetree node. Performed by regex find and replace in vscode using: find - `^(\t*)itcm:([^}]*|\n*)\};` replace - `$1itcm:$2\tlabel = "ITCM";\n$1};` Signed-off-by: Jordan Yates <[email protected]>
Change the label of the `ti_ccfg` partition to match the expected name of the outputted linker memory region. Signed-off-by: Jordan Yates <[email protected]>
Derive the names of linker memory regions from the specified devicetree
node, instead of providing a hardcoded value. This is required to
automatically generate regions based on compatibles in the future. It
also lets systems derive the memory region name from a `chosen` or
`alias` node. For example:
```
chosen {
stm32,eth-dma = &sram3;
}
```
```
SECTION_DATA_PROLOGUE(eth_stm32,(NOLOAD),)
{
...
} > GROUP_LINK_IN(DT_LABEL(DT_CHOSEN(stm32_eth_dma)), ...))
```
Signed-off-by: Jordan Yates <[email protected]>
|
Why add labels instead of just using the DTS nodelabel? |
That is the alternate option, but:
|
|
Actually I think the biggest problem is from https://docs.zephyrproject.org/latest/guides/dts/intro.html#syntax-and-structure
|
Is it? |
|
I am happy to transition to generating from the node labels if that is the generally preferred solution. |
Thanks. I think that would indeed be preferred as in general we've tried to minimize their usage over the past years.
No preference on my part. |
|
Are you aware of any syntax that lets you change or add another nodelabel to a node in an overlay? Apart from just deleting the node and creating it again? |
|
Cheers. Interestingly it looks like doing this in overlays always results in |
@mbolivar-nordic Is that expected ? |
|
An overlay of Will result in a So it makes sense that the python labels have the order they do. |
|
Superseded by #36365 |
|
I haven't been following the discussion, but arbitrarily picking a node label as a canonical way to identify a node does not sound like a good approach. I will check #36365. |
Update the aarch32 linker file to automatically derive the name of memory regions from devicetree nodes instead of providing hardcoded values. This is required for automatic generation of regions based on compatibles, and also allows
chosenandaliasnodes to be used to control variable placement (as desired in #36152).Board and SoC updates were performed automatically via regex find and replace.